#include<iostream>
#include<string>
#include<algorithm>
#include<set>
using namespace std;
int main(void){
    set<string> st;
    string word = "";
	int n;
    cin >> n;
    int d = -1;
    for(int i = 0;i < n;i++){
        cin >> d;
        cin >> word;
        transform(word.begin(),word.end(),word.begin(),::tolower);
        if(d == 0){
            st.insert(word);
        }else if(d == 1){
            if(st.find(word) != st.end()){
            	cout << "Yes" << endl;
			}else{
				cout << "No" << endl;
			}
        }
    }
	return 0;
}
